<template>
  <div>
    <def-layout type="col0-24" :page="page" @invoke="invoke">
      <div slot="search" class="form-items">
        <!-- <el-form-item>
          <el-input v-model="formSearch.supplierName" placeholder="供应商" />
        </el-form-item> -->
      </div>
      <div slot="content" class="grid">
        <page-grid v-if="self!=null" :parent="self">
          <div slot="columns">
            <el-table-column prop="createYear" sortable align="center" label="年份" width="150" />
            <el-table-column prop="orderCount" sortable align="right" label="采购次数" width="150" />
            <el-table-column prop="orderSales" sortable align="right" label="采购金额" width="150" />
            <el-table-column prop="orderWeight" sortable align="right" label="采购重量(吨)" width="150" />
            <el-table-column prop="orderPayment" sortable align="right" label="已付货款" width="150" />
            <el-table-column prop="returnCount" sortable align="right" label="退货次数" width="150" />
          </div>
        </page-grid>
      </div>
    </def-layout>

  </div>
</template>
<script>
import adminSupport from 'lola-admin-support-el'

export default {
  name: 'PurchaseYearManage',
  components: {
  },
  mixins: [adminSupport.mixins.index],
  data() {
    return {
      name: 'PurchaseYearManage',
      formSearch: { supplierName: '', createDate: [] },
      self: null
    }
  },
  created() {
    this.init()// 页面自定义初始化
  },
  methods: {
    init() {
      var that = this
      this.dataGrid.params.sortFields = 'createYear_d'
      // Excel导出配置
      this.page.excelParams = {
        fileds: ['createYear', 'orderCount', 'orderSales', 'orderWeight', 'orderPayment', 'returnCount'],
        queryParam: this.dataGrid.params,
        size: 10000
      }
      that.loadData()// 加载数据(按钮+列表) 扩展需重写该方法
      this.self = that
      this.dataGrid.table.tool = false
    },
    search() {
      const queryList = []
      this.dataGrid.params.queryList = queryList
      this.refresh()
    },
    bindSearch() {
      this.formSearch = { supplierName: '', createDate: [] }
    }
  }
}
</script>
